import request from '@/utils/request'

// 查询生产工单--外协列表
export function listOutsourcing(query) {
  return request({
    url: '/pro/outsourcing/list',
    method: 'get',
    params: query
  })
}
export function listOutsourcingForRecpt(query) {
  return request({
    url: '/pro/outsourcing/listForRecpt',
    method: 'get',
    params: query
  })
}

// 查询生产工单--外协详细
export function getOutsourcing(workorderId) {
  return request({
    url: '/pro/outsourcing/' + workorderId,
    method: 'get'
  })
}
export function getMdDrawByBomId(bomId) {
  return request({
    url: '/pro/outsourcing/getMdDrawByBomId/' + bomId,
    method: 'get'
  })
}
// 新增生产工单--外协
export function addOutsourcing(data) {
  return request({
    url: '/pro/outsourcing',
    method: 'post',
    data: data
  })
}


// 修改生产工单--外协
export function updateOutsourcing(data) {
  return request({
    url: '/pro/outsourcing',
    method: 'put',
    data: data
  })
}

// 删除生产工单--外协
export function delOutsourcing(workorderId) {
  return request({
    url: '/pro/outsourcing/' + workorderId,
    method: 'delete'
  })
}
export function addOutsourcingQc(data) {
  return request({
    url: '/pro/outsourcing/addOutsourcingQc',
    method: 'post',
    data: data
  })
}
export function goOutsourcingQc(workorderCode) {
  return request({
    url: '/pro/outsourcing/goQc/' + workorderCode,
    method: 'get'
  })
}
